<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>社交论坛 - 推荐内容</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --primary: #4267B2;
            --primary-light: #E9EBF5;
            --secondary: #1DA1F2;
            --success: #28a745;
            --danger: #dc3545;
            --dark: #2D3436;
            --light: #F8F9FA;
            --gray: #636E72;
            --border: #DFE6E9;
            --shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
            --shadow-hover: 0 5px 15px rgba(0, 0, 0, 0.1);
        }
        
        body {
            font-family: 'Inter', system-ui, -apple-system, sans-serif;
            background-color: #F5F7FA;
            color: var(--dark);
            line-height: 1.6;
        }
        
        .navbar {
            background-color: white;
            box-shadow: var(--shadow);
            padding: 0.75rem 1rem;
        }
        
        .navbar-brand {
            font-weight: 700;
            color: var(--primary);
            font-size: 1.5rem;
        }
        
        .search-bar {
            max-width: 600px;
            width: 100%;
            position: relative;
        }
        
        .search-input {
            width: 100%;
            padding: 0.6rem 1rem 0.6rem 2.5rem;
            border-radius: 20px;
            border: 1px solid var(--border);
            background-color: var(--light);
            transition: all 0.2s;
        }
        
        .search-input:focus {
            outline: none;
            background-color: white;
            box-shadow: 0 0 0 2px var(--primary-light);
            border-color: var(--primary);
        }
        
        .search-icon {
            position: absolute;
            left: 0.8rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--gray);
        }
        
        .nav-link {
            color: var(--dark);
            margin-left: 0.5rem;
            margin-right: 0.5rem;
            font-weight: 500;
            transition: color 0.2s;
        }
        
        .nav-link:hover, .nav-link.active {
            color: var(--primary);
        }
        
        .container {
            max-width: 1200px;
        }
        
        .section-title {
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 1.5rem;
            color: var(--dark);
            position: relative;
            padding-bottom: 0.5rem;
        }
        
        .section-title::after {
            content: '';
            position: absolute;
            left: 0;
            bottom: 0;
            width: 50px;
            height: 3px;
            background-color: var(--primary);
        }
        
        .forum-card {
            background-color: white;
            border-radius: 8px;
            box-shadow: var(--shadow);
            overflow: hidden;
            transition: transform 0.2s, box-shadow 0.2s;
            margin-bottom: 1.5rem;
        }
        
        .forum-card:hover {
            transform: translateY(-3px);
            box-shadow: var(--shadow-hover);
        }
        
        .card-header {
            padding: 1rem 1.25rem;
            border-bottom: 1px solid var(--border);
        }
        
        .author-info {
            display: flex;
            align-items: center;
        }
        
        .author-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            object-fit: cover;
            margin-right: 0.75rem;
        }
        
        .author-name {
            font-weight: 600;
            margin-bottom: 0;
        }
        
        .post-time {
            font-size: 0.85rem;
            color: var(--gray);
        }
        
        .card-body {
            padding: 1.25rem;
        }
        
        .post-title {
            font-size: 1.25rem;
            font-weight: 600;
            margin-bottom: 0.75rem;
            transition: color 0.2s;
        }
        
        .post-title:hover {
            color: var(--primary);
        }
        
        .post-content {
            color: var(--dark);
            margin-bottom: 1rem;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        .post-images {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1rem;
        }
        
        .post-image {
            border-radius: 4px;
            overflow: hidden;
            flex-shrink: 0;
        }
        
        .post-image.single {
            width: 100%;
            height: 200px;
        }
        
        .post-image.multi {
            width: 32%;
            height: 120px;
        }
        
        .post-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s;
        }
        
        .forum-card:hover .post-image img {
            transform: scale(1.03);
        }
        
        .card-footer {
            padding: 0.75rem 1.25rem;
            border-top: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background-color: var(--light);
        }
        
        .post-metrics {
            display: flex;
            gap: 1.5rem;
        }
        
        .metric {
            display: flex;
            align-items: center;
            gap: 0.25rem;
            color: var(--gray);
            font-size: 0.9rem;
        }
        
        .metric i {
            font-size: 1rem;
        }
        
        .post-actions {
            display: flex;
            gap: 1rem;
        }
        
        .action-btn {
            background: none;
            border: none;
            color: var(--gray);
            display: flex;
            align-items: center;
            gap: 0.25rem;
            font-size: 0.9rem;
            cursor: pointer;
            transition: color 0.2s;
        }
        
        .action-btn:hover {
            color: var(--primary);
        }
        
        .action-btn.liked {
            color: var(--danger);
        }
        
        .action-btn.bookmarked {
            color: var(--warning);
        }
        
        /* 网格布局特定样式 */
        .grid-layout .forum-card {
            height: 100%;
            display: flex;
            flex-direction: column;
        }
        
        .grid-layout .card-body {
            flex: 1;
            display: flex;
            flex-direction: column;
        }
        
        .grid-layout .post-content {
            flex: 1;
        }
        
        /* 大图布局特定样式 */
        .large-image-layout .forum-card {
            display: flex;
            flex-direction: row;
        }
        
        .large-image-layout .post-image {
            width: 40%;
            height: auto;
            flex-shrink: 0;
        }
        
        .large-image-layout .post-image.single {
            height: 100%;
        }
        
        .large-image-layout .card-content {
            width: 60%;
            display: flex;
            flex-direction: column;
        }
        
        .large-image-layout .card-body {
            flex: 1;
            display: flex;
            flex-direction: column;
        }
        
        .large-image-layout .post-content {
            flex: 1;
        }
        
        @media (max-width: 768px) {
            .large-image-layout .forum-card {
                flex-direction: column;
            }
            
            .large-image-layout .post-image,
            .large-image-layout .card-content {
                width: 100%;
            }
            
            .large-image-layout .post-image.single {
                height: 200px;
            }
            
            .post-image.multi {
                width: 48%;
            }
        }
        
        @media (max-width: 576px) {
            .post-image.multi {
                width: 100%;
                height: 150px;
            }
            
            .card-footer {
                flex-direction: column;
                gap: 0.5rem;
                align-items: flex-start;
            }
            
            .post-metrics {
                width: 100%;
                justify-content: space-between;
            }
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg">
        <div class="container">
            <a class="navbar-brand" href="#">社交论坛</a>
            
            <div class="search-bar mx-auto">
                <i class="fas fa-search search-icon"></i>
                <input type="text" class="search-input" placeholder="搜索论坛、话题或内容...">
            </div>
            
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <i class="fas fa-bars"></i>
            </button>
            
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav ms-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="#"><i class="fas fa-home me-1"></i> 首页</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link active" aria-current="page" href="#"><i class="fas fa-th-large me-1"></i> 论坛</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#"><i class="fas fa-compass me-1"></i> 发现</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#"><i class="fas fa-bell me-1"></i> 通知</a>
                    </li>
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">
                            <img src="https://picsum.photos/100/100?random=1" alt="用户头像" class="rounded-circle" style="width: 36px; height: 36px; object-fit: cover;">
                        </a>
                        <ul class="dropdown-menu dropdown-menu-end">
                            <li><a class="dropdown-item" href="#"><i class="fas fa-user me-2"></i> 个人中心</a></li>
                            <li><a class="dropdown-item" href="#"><i class="fas fa-bookmark me-2"></i> 我的收藏</a></li>
                            <li><a class="dropdown-item" href="#"><i class="fas fa-cog me-2"></i> 设置</a></li>
                            <li><hr class="dropdown-divider"></li>
                            <li><a class="dropdown-item" href="#"><i class="fas fa-sign-out-alt me-2"></i> 退出登录</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </nav>
    
    <!-- 主内容区 -->
    <div class="container py-5">
        <!-- 无图帖子布局 -->
        <section class="mb-8">
            <h2 class="section-title">热门讨论</h2>
            <div class="standard-layout">
                <!-- 无图帖子 1 -->
                <div class="forum-card">
                    <div class="card-header">
                        <div class="author-info">
                            <img src="https://picsum.photos/100/100?random=10" alt="张明头像" class="author-avatar">
                            <div>
                                <div class="author-name">张明</div>
                                <div class="post-time">2小时前 · 科技讨论区</div>
                            </div>
                        </div>
                    </div>
                    <div class="card-body">
                        <h3 class="post-title">人工智能在医疗领域的应用前景如何？</h3>
                        <p class="post-content">
                            最近看到很多关于AI在医疗诊断方面的研究，尤其是在影像识别领域已经取得了不错的成果。但也有人担心AI的决策缺乏透明度，在关键医疗决策中可能存在风险。大家觉得AI在医疗领域的应用还需要克服哪些障碍？未来几年会有突破性进展吗？
                        </p>
                    </div>
                    <div class="card-footer">
                        <div class="post-metrics">
                            <div class="metric">
                                <i class="fas fa-eye"></i>
                                <span>1,254</span>
                            </div>
                            <div class="metric">
                                <i class="fas fa-comment"></i>
                                <span>89</span>
                            </div>
                            <div class="metric">
                                <i class="fas fa-share"></i>
                                <span>32</span>
                            </div>
                        </div>
                        <div class="post-actions">
                            <button class="action-btn liked">
                                <i class="fas fa-heart"></i>
                                <span>245</span>
                            </button>
                            <button class="action-btn">
                                <i class="far fa-bookmark"></i>
                                <span>收藏</span>
                            </button>
                        </div>
                    </div>
                </div>
                
                <!-- 无图帖子 2 -->
                <div class="forum-card">
                    <div class="card-header">
                        <div class="author-info">
                            <img src="https://picsum.photos/100/100?random=11" alt="李婷头像" class="author-avatar">
                            <div>
                                <div class="author-name">李婷</div>
                                <div class="post-time">昨天 · 职场交流区</div>
                            </div>
                        </div>
                    </div>
                    <div class="card-body">
                        <h3 class="post-title">远程工作如何保持团队协作效率？</h3>
                        <p class="post-content">
                            我们团队已经远程工作快两年了，刚开始确实遇到了很多挑战。现在总结出了一些经验，比如固定每日简短站会、使用协作工具共享进度、明确任务分工和截止日期等。想问问大家有没有更好的方法？尤其是如何保持团队凝聚力和工作动力？
                        </p>
                    </div>
                    <div class="card-footer">
                        <div class="post-metrics">
                            <div class="metric">
                                <i class="fas fa-eye"></i>
                                <span>2,876</span>
                            </div>
                            <div class="metric">
                                <i class="fas fa-comment"></i>
                                <span>156</span>
                            </div>
                            <div class="metric">
                                <i class="fas fa-share"></i>
                                <span>94</span>
                            </div>
                        </div>
                        <div class="post-actions">
                            <button class="action-btn">
                                <i class="far fa-heart"></i>
                                <span>312</span>
                            </button>
                            <button class="action-btn bookmarked">
                                <i class="fas fa-bookmark"></i>
                                <span>收藏</span>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        
        <!-- 单图帖子布局 -->
        <section class="mb-8">
            <h2 class="section-title">精彩分享</h2>
            <div class="row grid-layout">
                <div class="col-md-6">
                    <!-- 单图帖子 1 -->
                    <div class="forum-card">
                        <div class="card-header">
                            <div class="author-info">
                                <img src="https://picsum.photos/100/100?random=20" alt="王浩头像" class="author-avatar">
                                <div>
                                    <div class="author-name">王浩</div>
                                    <div class="post-time">3天前 · 旅行分享区</div>
                                </div>
                            </div>
                        </div>
                        <div class="card-body">
                            <h3 class="post-title">徒步虎跳峡的难忘经历</h3>
                            <p class="post-content">
                                上周完成了虎跳峡徒步，虽然过程很辛苦，但风景真的值得！尤其是在中途客栈看到的星空，简直毕生难忘。分享一张清晨在山顶拍摄的照片，云海真的太美了。
                            </p>
                            <div class="post-images">
                                <div class="post-image single">
                                    <img src="https://picsum.photos/800/500?random=30" alt="虎跳峡风景">
                                </div>
                            </div>
                        </div>
                        <div class="card-footer">
                            <div class="post-metrics">
                                <div class="metric">
                                    <i class="fas fa-eye"></i>
                                    <span>3,567</span>
                                </div>
                                <div class="metric">
                                    <i class="fas fa-comment"></i>
                                    <span>124</span>
                                </div>
                            </div>
                            <div class="post-actions">
                                <button class="action-btn liked">
                                    <i class="fas fa-heart"></i>
                                    <span>567</span>
                                </button>
                                <button class="action-btn">
                                    <i class="far fa-bookmark"></i>
                                    <span>收藏</span>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="col-md-6">
                    <!-- 单图帖子 2 -->
                    <div class="forum-card">
                        <div class="card-header">
                            <div class="author-info">
                                <img src="https://picsum.photos/100/100?random=21" alt="陈静头像" class="author-avatar">
                                <div>
                                    <div class="author-name">陈静</div>
                                    <div class="post-time">4天前 · 美食分享区</div>
                                </div>
                            </div>
                        </div>
                        <div class="card-body">
                            <h3 class="post-title">自制草莓提拉米苏的秘诀</h3>
                            <p class="post-content">
                                周末尝试做了草莓提拉米苏，用新鲜草莓代替了传统的可可粉，口感更清新。关键是要选对马斯卡彭奶酪，还有手指饼干浸泡咖啡酒的时间不能太长，否则会太软。
                            </p>
                            <div class="post-images">
                                <div class="post-image single">
                                    <img src="https://picsum.photos/800/500?random=31" alt="草莓提拉米苏">
                                </div>
                            </div>
                        </div>
                        <div class="card-footer">
                            <div class="post-metrics">
                                <div class="metric">
                                    <i class="fas fa-eye"></i>
                                    <span>2,189</span>
                                </div>
                                <div class="metric">
                                    <i class="fas fa-comment"></i>
                                    <span>76</span>
                                </div>
                            </div>
                            <div class="post-actions">
                                <button class="action-btn">
                                    <i class="far fa-heart"></i>
                                    <span>324</span>
                                </button>
                                <button class="action-btn bookmarked">
                                    <i class="fas fa-bookmark"></i>
                                    <span>收藏</span>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        
        <!-- 多图帖子布局 -->
        <section class="mb-8">
            <h2 class="section-title">生活记录</h2>
            <div class="standard-layout">
                <!-- 多图帖子 1 -->
                <div class="forum-card">
                    <div class="card-header">
                        <div class="author-info">
                            <img src="https://picsum.photos/100/100?random=40" alt="刘强头像" class="author-avatar">
                            <div>
                                <div class="author-name">刘强</div>
                                <div class="post-time">1周前 · 摄影分享区</div>
                            </div>
                        </div>
                    </div>
                    <div class="card-body">
                        <h3 class="post-title">城市建筑摄影合集</h3>
                        <p class="post-content">
                            最近对城市建筑摄影产生了兴趣，整理了一组不同角度拍摄的城市建筑照片。包括现代摩天大楼和传统建筑的对比，光影变化下的建筑形态等。欢迎摄影爱好者交流技巧！
                        </p>
                        <div class="post-images">
                            <div class="post-image multi">
                                <img src="https://picsum.photos/600/400?random=50" alt="建筑照片1">
                            </div>
                            <div class="post-image multi">
                                <img src="https://picsum.photos/600/400?random=51" alt="建筑照片2">
                            </div>
                            <div class="post-image multi">
                                <img src="https://picsum.photos/600/400?random=52" alt="建筑照片3">
                            </div>
                        </div>
                    </div>
                    <div class="card-footer">
                        <div class="post-metrics">
                            <div class="metric">
                                <i class="fas fa-eye"></i>
                                <span>4,892</span>
                            </div>
                            <div class="metric">
                                <i class="fas fa-comment"></i>
                                <span>187</span>
                            </div>
                            <div class="metric">
                                <i class="fas fa-share"></i>
                                <span>124</span>
                            </div>
                        </div>
                        <div class="post-actions">
                            <button class="action-btn liked">
                                <i class="fas fa-heart"></i>
                                <span>789</span>
                            </button>
                            <button class="action-btn">
                                <i class="far fa-bookmark"></i>
                                <span>收藏</span>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        
        <!-- 大图布局帖子 -->
        <section class="mb-8">
            <h2 class="section-title">精选内容</h2>
            <div class="large-image-layout">
                <!-- 大图布局帖子 1 -->
                <div class="forum-card">
                    <div class="post-image single">
                        <img src="https://picsum.photos/800/600?random=60" alt="山地自行车比赛">
                    </div>
                    <div class="card-content">
                        <div class="card-header">
                            <div class="author-info">
                                <img src="https://picsum.photos/100/100?random=61" alt="赵伟头像" class="author-avatar">
                                <div>
                                    <div class="author-name">赵伟</div>
                                    <div class="post-time">2周前 · 运动健身区</div>
                                </div>
                            </div>
                        </div>
                        <div class="card-body">
                            <h3 class="post-title">第一次参加山地自行车比赛的体验</h3>
                            <p class="post-content">
                                作为一名骑行爱好者，终于鼓起勇气参加了人生第一次山地自行车比赛。虽然没有获得名次，但整个过程收获很多。赛道比想象中更具挑战性，尤其是下坡路段需要很好的控车技巧。感谢一路上给予鼓励的其他选手，这就是运动的魅力吧！
                            </p>
                        </div>
                        <div class="card-footer">
                            <div class="post-metrics">
                                <div class="metric">
                                    <i class="fas fa-eye"></i>
                                    <span>5,231</span>
                                </div>
                                <div class="metric">
                                    <i class="fas fa-comment"></i>
                                    <span>215</span>
                                </div>
                                <div class="metric">
                                    <i class="fas fa-share"></i>
                                    <span>156</span>
                                </div>
                            </div>
                            <div class="post-actions">
                                <button class="action-btn liked">
                                    <i class="fas fa-heart"></i>
                                    <span>943</span>
                                </button>
                                <button class="action-btn bookmarked">
                                    <i class="fas fa-bookmark"></i>
                                    <span>收藏</span>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        // 点赞和收藏功能交互
        document.addEventListener('DOMContentLoaded', function() {
            // 点赞按钮交互
            const likeButtons = document.querySelectorAll('.action-btn:not(.bookmarked)');
            likeButtons.forEach(button => {
                button.addEventListener('click', function() {
                    const icon = this.querySelector('i');
                    const countSpan = this.querySelector('span');
                    let count = parseInt(countSpan.textContent);
                    
                    if (icon.classList.contains('far')) {
                        // 未点赞状态，点击后变为已点赞
                        icon.classList.remove('far');
                        icon.classList.add('fas', 'liked');
                        this.classList.add('liked');
                        countSpan.textContent = count + 1;
                    } else {
                        // 已点赞状态，点击后取消点赞
                        icon.classList.remove('fas', 'liked');
                        icon.classList.add('far');
                        this.classList.remove('liked');
                        countSpan.textContent = count - 1;
                    }
                });
            });
            
            // 收藏按钮交互
            const bookmarkButtons = document.querySelectorAll('.action-btn:has(.fa-bookmark)');
            bookmarkButtons.forEach(button => {
                button.addEventListener('click', function() {
                    const icon = this.querySelector('i');
                    
                    if (icon.classList.contains('far')) {
                        // 未收藏状态，点击后变为已收藏
                        icon.classList.remove('far');
                        icon.classList.add('fas');
                        this.classList.add('bookmarked');
                    } else {
                        // 已收藏状态，点击后取消收藏
                        icon.classList.remove('fas');
                        icon.classList.add('far');
                        this.classList.remove('bookmarked');
                    }
                });
            });
        });
    </script>
</body>
</html>

